package com.cx.bank.Aspect;


import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import java.util.Date;

// 声明当前类为切面类
@Aspect
public class MyAspect {
    // 前置通知
    @Before(value = "execution(* *..controller.*.do*(..))")
    public void myBefore(JoinPoint joinPoint){
        System.out.println("准备执行"+joinPoint.getSignature().getName()+"操作...");
    }
    @Around(value = "execution(* *..controller.*.do*(..))")
    public Object myAround(ProceedingJoinPoint point) throws Throwable {
        Object result = null;
        System.out.println("执行"+point.getSignature().getName()+"操作前的时间...");
        point.proceed();
        System.out.println("在执行"+point.getSignature().getName()+"后提交事务");
        return result;
    }
}
